package com.keith.foothandframe.hutool;

import cn.hutool.core.io.FileUtil;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author chenli
 * @date 2024/1/22 16:19
 **/
public class ReadTxt {

    public static void main(String[] args) {
        String filePath = "C:\\Users\\zhongxiaobin\\Desktop\\new 6";
        try {
            List<String> lines = FileUtil.readUtf8Lines(filePath);

            String lineStr = String.join(",", lines);

            FileUtil.writeUtf8String(lineStr, "C:\\Users\\zhongxiaobin\\Desktop\\new 6");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
